/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function SelectAllCheckboxesSpecific(spanChk){
    var IsChecked = spanChk.checked;
    var Chk = spanChk;
    Parent = document.getElementById('form:mytable');
    var items = Parent.getElementsByTagName('input');
    for (i = 0; i < items.length; i++){
        if (items[i].id != Chk && items[i].type == "checkbox"){
            if (items[i].checked != IsChecked){
                items[i].click();
            }
        }
    }
}

function computeTotal(){
    var units=document.getElementById('form:units').value;
    if(units==""){
        units=1;
    }
    var amount=document.getElementById('form:expenseAmount').value;
    if(amount==""){
        amount=0;
    }
    var total=amount * units;
    document.getElementById('form:expenseTotal').setAttribute('value',total);
}

function empSubFun(){
    if(document.getElementById('form:radio:0').checked) {
        document.getElementById('form:employee').style.display = 'block';
        document.getElementById('form:subcontResName').value= '1';
        document.getElementById('form:subcontResName').style.display = 'none';
    }else if(document.getElementById('form:radio:1').checked) {
        document.getElementById('form:employee').value = '1';
        document.getElementById('form:employee').style.display = 'none';
        document.getElementById('form:subcontResName').style.display = 'block';
    }
}

